package leetcode;
//2020蓝桥杯既约分数
public class 欧几里得 {
    public static void main(String[] args) {
        int num=0;
        for (int i = 2; i <2021 ; i++) {
            for (int j = i+1; j < 2021; j++) {
//                if(j%i==0)continue;
                if(gcd(j,i)==1) num++;
            }
        }
        int sum=num*2+2020+2020-1;//减去重复的1
        System.out.println(sum);
    }
    static int gcd(int a,int b){
        if(b==0)return a;
        else return gcd(b,a%b);
    }
}
